** ANALYSES
version 17
cd "\\home.gu.gu.se\home-XJ$\xjoerc\Documents\CeCAR\Nature"
use "data\appended", clear

* DESCRIPTIVE STATISTICS
bysort Splitgroup: tab Q1
* 1. Taxes (climate)
sum Q1 if Splitgroup==1
sum Q1 if Splitgroup==1 & cname=="Ecuador"
sum Q1 if Splitgroup==1 & cname=="Egypt"
sum Q1 if Splitgroup==1 & cname=="India"
sum Q1 if Splitgroup==1 & cname=="Indonesia"
sum Q1 if Splitgroup==1 & cname=="Mexico"
* 2. Production subsidies (climate)
sum Q1 if Splitgroup==2
sum Q1 if Splitgroup==2 & cname=="Ecuador"
sum Q1 if Splitgroup==2 & cname=="Egypt"
sum Q1 if Splitgroup==2 & cname=="India"
sum Q1 if Splitgroup==2 & cname=="Indonesia"
sum Q1 if Splitgroup==2 & cname=="Mexico"
* 3. Private consumption subsidies (Climate)
sum Q1 if Splitgroup==3
sum Q1 if Splitgroup==3 & cname=="Ecuador"
sum Q1 if Splitgroup==3 & cname=="Egypt"
sum Q1 if Splitgroup==3 & cname=="India"
sum Q1 if Splitgroup==3 & cname=="Indonesia"
sum Q1 if Splitgroup==3 & cname=="Mexico"
* 4. Private consumption subsidies (Climate + Welfare)
sum Q1 if Splitgroup==4
sum Q1 if Splitgroup==4 & cname=="Ecuador"
sum Q1 if Splitgroup==4 & cname=="Egypt"
sum Q1 if Splitgroup==4 & cname=="India"
sum Q1 if Splitgroup==4 & cname=="Indonesia"
sum Q1 if Splitgroup==4 & cname=="Mexico"
* 5. Private consumption subsidies (a general reduction of the income tax)
sum Q1 if Splitgroup==5
sum Q1 if Splitgroup==5 & cname=="Ecuador"
sum Q1 if Splitgroup==5 & cname=="Egypt"
sum Q1 if Splitgroup==5 & cname=="India"
sum Q1 if Splitgroup==5 & cname=="Indonesia"
sum Q1 if Splitgroup==5 & cname=="Mexico"
* 6. Private consumption subsidies (Climate + Adaptation)
sum Q1 if Splitgroup==6
sum Q1 if Splitgroup==6 & cname=="Ecuador"
sum Q1 if Splitgroup==6 & cname=="Egypt"
sum Q1 if Splitgroup==6 & cname=="India"
sum Q1 if Splitgroup==6 & cname=="Indonesia"
sum Q1 if Splitgroup==6 & cname=="Mexico"
* 7. Private consumption subsidies (Cash transfers to poor and most affected households)
sum Q1 if Splitgroup==7
sum Q1 if Splitgroup==7 & cname=="Ecuador"
sum Q1 if Splitgroup==7 & cname=="Egypt"
sum Q1 if Splitgroup==7 & cname=="India"
sum Q1 if Splitgroup==7 & cname=="Indonesia"
sum Q1 if Splitgroup==7 & cname=="Mexico"

******************************************
* Regression table ***********************
******************************************
* RUN THESE LINES BEFORE REGRESSIONS:
* START
clonevar edu=Q2
recode edu 5=.
clonevar female=gender
clonevar income=Q3
recode income 1=1 2/3=2 4/9=3 10/11=.
label define income 1"Less than $5,000" 2"$5,000-$19,999" 3"$20,000 or more"
label value income income
recode Q4 1/2=4 3/5=3 6=2 7=1, gen(urbrur)
label define urbrur 1"Rural" 2"Small town" 3"City/large town" 4"Big city"
label value urbrur urbrur
clonevar concern=Q5
recode Q6 2=0 3=., gen(fossilvehicle)
* Categorical variables --> dummy variables
qui tab age1, gen(agecat)
qui tab edu, gen(educat)
qui tab urbrur, gen(urbrurcat)
qui tab income, gen(incomecat)
** Standardized variables
egen std_female=std(female)
egen std_agecat1=std(agecat1)
egen std_agecat2=std(agecat2)
egen std_agecat3=std(agecat3)
egen std_agecat4=std(agecat4)
egen std_agecat5=std(agecat5)
egen std_educat1=std(educat1)
egen std_educat2=std(educat2)
egen std_educat3=std(educat3)
egen std_educat4=std(educat4)
egen std_urbrurcat1=std(urbrurcat1)
egen std_urbrurcat2=std(urbrurcat2)
egen std_urbrurcat3=std(urbrurcat3)
egen std_urbrurcat4=std(urbrurcat4)
egen std_incomecat1=std(incomecat1)
egen std_incomecat2=std(incomecat2)
egen std_incomecat3=std(incomecat3)
egen std_concern=std(concern)
egen std_fossilvehicle=std(fossilvehicle)
* Labels for coefplot
label var std_female "Female"
label var std_agecat2 "25-34 years"
label var std_agecat3 "35-44 years"
label var std_agecat4 "45-54 years"
label var std_agecat5 "55+ years"
label var std_educat2 "6-9 years"
label var std_educat3 "10-14 years"
label var std_educat4 "15 or more years"
label var std_urbrurcat2 "Small town"
label var std_urbrurcat3 "City/Large town"
label var std_urbrurcat4 "Big city"
label var std_incomecat2 "$5,000-$19,999"
label var std_incomecat3 "$20,000 or more"
label var std_concern "Climate concern"
label var std_fossilvehicle "Owns fossil fueled vehicle"
* STOP

* Tabulation of main variables
tab female
tab age1
tab edu
tab urbrur
tab income
tab concern
tab fossilvehicle

* Tabulation of main variables per country and group
tab female if		 cname=="Ecuador" & Splitgroup==1
tab age1 if			 cname=="Ecuador" & Splitgroup==1
tab edu if			 cname=="Ecuador" & Splitgroup==1
tab urbrur if		 cname=="Ecuador" & Splitgroup==1
tab income if		 cname=="Ecuador" & Splitgroup==1
tab concern if		 cname=="Ecuador" & Splitgroup==1
tab fossilvehicle if cname=="Ecuador" & Splitgroup==1

* Summation of climate concern per experiment group
sum Q5 if Splitgroup==1
sum Q5 if Splitgroup==2
sum Q5 if Splitgroup==3
sum Q5 if Splitgroup==4
sum Q5 if Splitgroup==5
sum Q5 if Splitgroup==6
sum Q5 if Splitgroup==7

* Summation of main variables
sum Q1 if Splitgroup==1
sum Q1 if Splitgroup==2
sum Q1 if Splitgroup==3
sum Q1 if Splitgroup==4
sum Q1 if Splitgroup==5
sum Q1 if Splitgroup==6
sum Q1 if Splitgroup==7
sum female
sum age1
sum edu
sum urbrur
sum income
sum concern
sum fossilvehicle

* Figure 1
tabstat Q1 if Splitgroup==3, stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==4, stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==5, stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==6, stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==7, stats(mean sd semean min max n)

* Figure 2
tabstat Q1 if Splitgroup==1 & cname=="Mexico", stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==2 & cname=="Mexico", stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==3 & cname=="Mexico", stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==1 & cname=="Indonesia", stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==2 & cname=="Indonesia", stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==3 & cname=="Indonesia", stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==1 & cname=="India", stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==2 & cname=="India", stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==3 & cname=="India", stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==1 & cname=="Egypt", stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==2 & cname=="Egypt", stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==3 & cname=="Egypt", stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==1 & cname=="Ecuador", stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==2 & cname=="Ecuador", stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==3 & cname=="Ecuador", stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==1, stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==2, stats(mean sd semean min max n)
tabstat Q1 if Splitgroup==3, stats(mean sd semean min max n)

* Figure 1 and 3 (change cname depending on which country you want for fig 3)
gen fourfivesixsevenvsthree=.
replace fourfivesixsevenvsthree=0 if Splitgroup==3
replace fourfivesixsevenvsthree=1 if Splitgroup==4 | Splitgroup==5 | Splitgroup==6 | Splitgroup==7
reg Q1 i.fourfivesixsevenvsthree, robust //Revenue specified

gen fourvsthree=.
replace fourvsthree=0 if Splitgroup==3
replace fourvsthree=1 if Splitgroup==4
reg Q1 i.fourvsthree, robust //add if cname="xxxx"

gen fivevsthree=.
replace fivevsthree=0 if Splitgroup==3
replace fivevsthree=1 if Splitgroup==5
reg Q1 i.fivevsthree, robust

gen sixvsthree=.
replace sixvsthree=0 if Splitgroup==3
replace sixvsthree=1 if Splitgroup==6
reg Q1 i.sixvsthree, robust

gen sevenvsthree=.
replace sevenvsthree=0 if Splitgroup==3
replace sevenvsthree=1 if Splitgroup==7
reg Q1 i.sevenvsthree, robust

* Figure 2 NEW
gen twovsone=.
replace twovsone=0 if Splitgroup==1
replace twovsone=1 if Splitgroup==2
gen threevsone=.
replace threevsone=0 if Splitgroup==1
replace threevsone=1 if Splitgroup==3
reg Q1 i.twovsone, robust
reg Q1 i.threevsone, robust
reg Q1 i.twovsone if cname=="Mexico", robust
reg Q1 i.threevsone if cname=="Mexico", robust
reg Q1 i.twovsone if cname=="Indonesia", robust
reg Q1 i.threevsone if cname=="Indonesia", robust
reg Q1 i.twovsone if cname=="India", robust
reg Q1 i.threevsone if cname=="India", robust
reg Q1 i.twovsone if cname=="Egypt", robust
reg Q1 i.threevsone if cname=="Egypt", robust
reg Q1 i.twovsone if cname=="Ecuador", robust
reg Q1 i.threevsone if cname=="Ecuador", robust

* UNstandardized OLS
reg Q1 female i.age1 i.edu i.urbrur i.income concern fossilvehicle, robust
*eststo all
reg Q1 female i.age1 i.edu i.urbrur i.income concern fossilvehicle if Splitgroup==1, robust
reg Q1 female i.age1 i.edu i.urbrur i.income concern fossilvehicle if Splitgroup==2, robust
reg Q1 female i.age1 i.edu i.urbrur i.income concern fossilvehicle if Splitgroup==3, robust
reg Q1 female i.age1 i.edu i.urbrur i.income concern fossilvehicle if Splitgroup==4, robust
reg Q1 female i.age1 i.edu i.urbrur i.income concern fossilvehicle if Splitgroup==5, robust
reg Q1 female i.age1 i.edu i.urbrur i.income concern fossilvehicle if Splitgroup==6, robust
reg Q1 female i.age1 i.edu i.urbrur i.income concern fossilvehicle if Splitgroup==7, robust

* Standardized OLS
reg Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle, robust
eststo std_pooled

reg Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup>=2, robust
eststo std_subsidies

reg Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup==1, robust
eststo std_1

reg Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup==2, robust
eststo std_2

reg Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup==3, robust
eststo std_3

reg Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup==4, robust
eststo std_4

reg Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup==5, robust
eststo std_5

reg Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup==6, robust
eststo std_6

reg Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup==7, robust
eststo std_7

* Standardized Ologit
ologit Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle, or robust
eststo ologit_std_pooled

ologit Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup>=2, or robust
eststo ologit_std_subsidies

ologit Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup==1, or robust
eststo ologit_std_1

ologit Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup==2, or robust
eststo ologit_std_2

ologit Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup==3, or robust
eststo ologit_std_3

ologit Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup==4, or robust
eststo ologit_std_4

ologit Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup==5, or robust
eststo ologit_std_5

ologit Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup==6, or robust
eststo ologit_std_6

ologit Q1 std_female std_agecat2 std_agecat3 std_agecat4 std_agecat5 std_educat2 std_educat3 std_educat4 std_urbrurcat2 std_urbrurcat3 std_urbrurcat4 std_incomecat2 std_incomecat3 std_concern std_fossilvehicle if Splitgroup==7, or robust
eststo ologit_std_7

****************
* Coefplot *****
****************
* Pooled group (run labels above before)
graph set window fontface "Century Schoolbook"
coefplot (std_pooled), drop(_cons) xline(0) title(All groups (pooled)) subtitle(Standardized beta coefficients) headings(std_female="{bf:Gender}" std_agecat2="{bf:Age}" std_educat2="{bf:Education}" std_urbrurcat2="{bf:Rural/Urban}" std_incomecat2="{bf:Household income}" std_concern="{bf:Other}") byopts(compact)
graph export "coefplot_pooled.emf", replace

graph set window fontface "Century Schoolbook"
coefplot (std_subsidies), drop(_cons) xline(0) title(Removal of fossil fuel subsidies (pooled)) subtitle(Standardized beta coefficients) headings(std_female="{bf:Gender}" std_agecat2="{bf:Age}" std_educat2="{bf:Education}" std_urbrurcat2="{bf:Rural/Urban}" std_incomecat2="{bf:Household income}" std_concern="{bf:Other}") byopts(compact)
graph export "coefplot_subsidies.emf", replace

graph set window fontface "Century Schoolbook"
coefplot (std_1), drop(_cons) xline(0) title(Group 1: Taxes) subtitle(Standardized beta coefficients) headings(std_female="{bf:Gender}" std_agecat2="{bf:Age}" std_educat2="{bf:Education}" std_urbrurcat2="{bf:Rural/Urban}" std_incomecat2="{bf:Household income}" std_concern="{bf:Other}") byopts(compact)
graph export "Supplementary\coefplot_1.emf", replace

graph set window fontface "Century Schoolbook"
coefplot (std_2), drop(_cons) xline(0) title(Group 2: Production consumption subsidies) subtitle(Standardized beta coefficients) headings(std_female="{bf:Gender}" std_agecat2="{bf:Age}" std_educat2="{bf:Education}" std_urbrurcat2="{bf:Rural/Urban}" std_incomecat2="{bf:Household income}" std_concern="{bf:Other}")
graph export "Supplementary\coefplot_2.emf", replace

graph set window fontface "Century Schoolbook"
coefplot (std_3), drop(_cons) xline(0) title(Group 3: Private consumption subsidies) subtitle(Standardized beta coefficients) headings(std_female="{bf:Gender}" std_agecat2="{bf:Age}" std_educat2="{bf:Education}" std_urbrurcat2="{bf:Rural/Urban}" std_incomecat2="{bf:Household income}" std_concern="{bf:Other}")
graph export "Supplementary\coefplot_3.emf", replace

graph set window fontface "Century Schoolbook"
coefplot (std_4), drop(_cons) xline(0) title(Group 4: Private consumption subsidies - Welfare) subtitle(Standardized beta coefficients) headings(std_female="{bf:Gender}" std_agecat2="{bf:Age}" std_educat2="{bf:Education}" std_urbrurcat2="{bf:Rural/Urban}" std_incomecat2="{bf:Household income}" std_concern="{bf:Other}")
graph export "Supplementary\coefplot_4.emf", replace

graph set window fontface "Century Schoolbook"
coefplot (std_5), drop(_cons) xline(0) title(Group 5: Private consumption subsidies - Income tax reduction) subtitle(Standardized beta coefficients) headings(std_female="{bf:Gender}" std_agecat2="{bf:Age}" std_educat2="{bf:Education}" std_urbrurcat2="{bf:Rural/Urban}" std_incomecat2="{bf:Household income}" std_concern="{bf:Other}")
graph export "Supplementary\coefplot_5.emf", replace

graph set window fontface "Century Schoolbook"
coefplot (std_6), drop(_cons) xline(0) title(Group 6: Private consumption subsidies - Adaptation) subtitle(Standardized beta coefficients) headings(std_female="{bf:Gender}" std_agecat2="{bf:Age}" std_educat2="{bf:Education}" std_urbrurcat2="{bf:Rural/Urban}" std_incomecat2="{bf:Household income}" std_concern="{bf:Other}")
graph export "Supplementary\coefplot_6.emf", replace

graph set window fontface "Century Schoolbook"
coefplot (std_7), drop(_cons) xline(0) title(Group 7: Private consumption subsidies - Transfer to most affected) subtitle(Standardized beta coefficients) headings(std_female="{bf:Gender}" std_agecat2="{bf:Age}" std_educat2="{bf:Education}" std_urbrurcat2="{bf:Rural/Urban}" std_incomecat2="{bf:Household income}" std_concern="{bf:Other}")
graph export "Supplementary\coefplot_7.emf", replace

***************************
** HYPOTHESIS TESTING *****
***************************
* ttesti #obs1 #mean1 #sd1 #obs2 #mean2 #sd2, unequal
* H1
ttesti 949 6.306639 2.665961 949 6.32666 2.771299, unequal // 3 < 1
ttesti 952 6.222689 2.573175 949 6.32666 2.771299, unequal // 2 < 1
sum Q1 if Splitgroup==3 | Splitgroup==2
ttesti 1901 6.264598 2.619553 949 6.32666 2.771299, unequal // 3+2 < 1
* H2
ttesti 949 6.306639 2.665961 952 6.222689 2.573175, unequal // 3 < 2
* H3
sum Q1 if Splitgroup==4 | Splitgroup==5 | Splitgroup==6 | Splitgroup==7
ttesti 3786 6.487586 2.586619 949 6.306639 2.665961, unequal // 4+5+6+7 > 3
ttesti 951 6.588854 2.546875 949 6.306639 2.665961, unequal // 4 > 3
ttesti 947 6.247096 2.476567 949 6.306639 2.665961, unequal // 5 > 3
ttesti 941 6.620616 2.650484 949 6.306639 2.665961, unequal // 6 > 3
ttesti 947 6.494192 2.656262 949 6.306639 2.665961, unequal // 7 > 3

* OLS regressions
* H1
gen threevsone=.
replace threevsone=0 if Splitgroup==1
replace threevsone=1 if Splitgroup==3
reg Q1 i.threevsone, robust

gen twovsone=.
replace twovsone=0 if Splitgroup==1
replace twovsone=1 if Splitgroup==2
reg Q1 i.twovsone, robust

gen threetwovsone=.
replace threetwovsone=0 if Splitgroup==1
replace threetwovsone=1 if Splitgroup==3 | Splitgroup==2
reg Q1 i.threetwovsone, robust

* H2
gen threevstwo=.
replace threevstwo=0 if Splitgroup==2
replace threevstwo=1 if Splitgroup==3
reg Q1 i.threevstwo, robust

* H3
gen fourfivesixsevenvsthree=.
replace fourfivesixsevenvsthree=0 if Splitgroup==3
replace fourfivesixsevenvsthree=1 if Splitgroup==4 | Splitgroup==5 | Splitgroup==6 | Splitgroup==7
reg Q1 i.fourfivesixsevenvsthree, robust

gen fourvsthree=.
replace fourvsthree=0 if Splitgroup==3
replace fourvsthree=1 if Splitgroup==4
reg Q1 i.fourvsthree, robust

gen fivevsthree=.
replace fivevsthree=0 if Splitgroup==3
replace fivevsthree=1 if Splitgroup==5
reg Q1 i.fivevsthree, robust

gen sixvsthree=.
replace sixvsthree=0 if Splitgroup==3
replace sixvsthree=1 if Splitgroup==6
reg Q1 i.sixvsthree, robust

gen sevenvsthree=.
replace sevenvsthree=0 if Splitgroup==3
replace sevenvsthree=1 if Splitgroup==7
reg Q1 i.sevenvsthree, robust

*** Tests with subset of respondents who completed the survey within two standard deviations' time
preserve
sum tot_time, d
drop if tot_time < (r(mean) - 2 * r(sd) ) | tot_time > (r(mean) + 2 * r(sd))
* ttesti #obs1 #mean1 #sd1 #obs2 #mean2 #sd2, unequal
* H1
sum Q1 if Splitgroup==3
sum Q1 if Splitgroup==1
ttesti 946 6.300211 2.664432 937 6.319104 2.770338, unequal // 3 < 1
* H2
sum Q1 if Splitgroup==3
sum Q1 if Splitgroup==2
ttesti 946 6.300211 2.664432 950 6.22 2.572658, unequal // 3 < 2
* H3
sum Q1 if Splitgroup==4 | Splitgroup==5 | Splitgroup==6 | Splitgroup==7
sum Q1 if Splitgroup==3
ttesti 3763 6.489503 2.581079 946 6.300211 2.664432, unequal // 4+5+6+7 > 3


*** Tests with subset of respondents who completed the survey within two standard deviations' time
* OLS regressions
drop threevsone threevstwo fourfivesixsevenvsthree
* H1
gen threevsone=.
replace threevsone=0 if Splitgroup==1
replace threevsone=1 if Splitgroup==3
reg Q1 i.threevsone, robust
* H2
gen threevstwo=.
replace threevstwo=0 if Splitgroup==2
replace threevstwo=1 if Splitgroup==3
reg Q1 i.threevstwo, robust
* H3
gen fourfivesixsevenvsthree=.
replace fourfivesixsevenvsthree=0 if Splitgroup==3
replace fourfivesixsevenvsthree=1 if Splitgroup==4 | Splitgroup==5 | Splitgroup==6 | Splitgroup==7
reg Q1 i.fourfivesixsevenvsthree, robust
restore

* Descriptives for 4, 5, 6, 7:
sum Q1 if fourfivesixsevenvsthree==1
sum Q1 if fourfivesixsevenvsthree==1 & cname=="Ecuador"
sum Q1 if fourfivesixsevenvsthree==1 & cname=="Egypt"
sum Q1 if fourfivesixsevenvsthree==1 & cname=="India"
sum Q1 if fourfivesixsevenvsthree==1 & cname=="Indonesia"
sum Q1 if fourfivesixsevenvsthree==1 & cname=="Mexico"

/*
* Alternative regression tests without neutral option(5)
recode Q1 5=. 0=1 1=2 2=3 3=4 4=5, gen(woneutral)
reg Q1 i.threevsone, robust
reg woneutral i.threevsone, robust
reg Q1 i.threevstwo, robust
reg woneutral i.threevstwo, robust
reg Q1 i.fourfivesixsevenvsthree, robust
reg woneutral i.fourfivesixsevenvsthree, robust
*/










/*
version 16
cd "\\home.gu.gu.se\home-XJ$\xjoerc\Documents\CeCAR\Nature"

** Ecuador
use "data\ecuador.dta", clear
gen country=1
gen cname="Ecuador"
save "data\ec.dta", replace

** Egypt
use "data\egypt.dta", clear
gen country=2
gen cname="Egypt"
save "data\eg.dta", replace

** India
use "data\india.dta", clear
gen country=3
gen cname="India"
save "data\in.dta", replace

** Indonesia
use "data\indonesia.dta", clear
gen country=4
gen cname="Indonesia"
save "data\id.dta", replace

** Mexico
use "data\mexico.dta", clear
gen country=5
gen cname="Mexico"
save "data\mx.dta", replace

** APPEND
use "data\ec", clear
append using "data\eg"
append using "data\in"
append using "data\id"
append using "data\mx"
save "data\appended", replace
*/
